define(["jquery","text!modules/seckill/seckill.html","css!modules/seckill/seckill.css"],function($,html){
	function render(){
		$("body").empty();
		$("body").append(html);	
		// 获取数据
		$.ajax({
			url:"http://www.vrserver.applinzi.com/aixianfeng/apimiaosha.php",
			type:"get",
			success:function data(res){
				var data=$.parseJSON(res);
				seckill(data);
			}
		});

		function seckill(data){
			var data=data.product;
			for(var i=0;i<data.length;i++){
				var li=$("<li/>");
				var img=$("<div class="+"seckill_img"+"></div>").css("backgroundImage","url("+data[i].img+")");
				var particular=("<div class="+"seckill_particular"+"><p class="+"seckill_name"+">"+data[i].name+"</p><p class="+"weight"+">"+data[i].specifics+"</p><p class="+"seckill_p"+"><span class="+"money"+">￥</span><span class="+"seckill_Nprice"+">"+data[i].price+"</span><span class="+"seckill_Oprice"+">"+" / 原价"+data[i].market_price+"元"+"</span></p><p class="+"seckill_btn"+"><span>"+data[i].btnText+"</span></p></div>");
				li.append(img).append(particular).appendTo($(".seckill"));
				if(li.find("strong").length>0){
					li.find(".seckill_btn").css("background","#ff602c");
				}		
			}
		}
	

	}
	return{
		render:render
	}
})